<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="description" content="" />
        <meta name="keywords" content="" />
        <meta name="author" content="Flying hormone" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta charset="UTF-8">
        <link rel="stylesheet" href="../css/media.css" />
        <link rel="stylesheet" href="../css/mui.min.css" />
        <link rel="stylesheet" href="../css/head_foot.css" />
        <script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="../js/jquery.Query.js" ></script>
        <script type="text/javascript" src="../js/jquery-cookie.js"></script>
        <script type="text/javascript" src="../js/mui.min.js"></script>
        <script type="text/javascript" src="../js/appcan.js"></script>
        <script type="text/javascript" src="../js/appcan.control.js"></script>
        <script type="text/javascript" src="../js/common.js" ></script>
		<title>活动详情</title>
		<style>
            
            .xiangqing img{ width: 100%;}
            li,ol,ul{ list-style: none;}
            .xiangqing{ position: relative; }
            .xiangqing img{ width: 100%;}
            .xiangqing div{padding: 0.3em;}
            .xiangqing li{  word-wrap: break-word; white-space: pre-wrap; word-break: break-all; width: 100%;}
            .xiangqing h3{ color: #fff; margin-bottom: 0.625em; line-height: 1em;}
            .xiangqing h4{ color: #fff; font-size: 0.8rem; margin-top: 0.3125em;}
            
            footer{
                position: fixed;
                bottom: 0;
                z-index: 100;
                height: 3em;
                width: 100%;
                background-color: #efefef;
                overflow: initial;
            }
            footer div{ width: 50%; float: left; height: 100%;}
            footer div p{ width: 100%; height: 100%; line-height: 3em;}
            .liulan{ text-align: right; padding-right: 0.625em;}
            .liulan img{ height: 1em; margin-right: 0.3125em;}
            .liulan p{ font-size: 1.25em;}
            .caozuo{ position: relative;}
            .caozuo>a>img{ height: 1.5em; margin: 0.5em; position: absolute; left: 0;}
            .caozuo a{ font-size: 1.25em; line-height: 2.5em; position: relative; text-indent: 2.25em; background: #ececec; padding-right: 0.625em;}
            footer i{ font-style: normal; color: #ff3366;}
            footer nav a{
                    display: table-cell;
                    overflow: hidden;
                    width: 1%;
                    height: 3.125em;
                    text-align: center;
                    vertical-align: middle;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    color: #929292;
            }
            
            footer nav a img {
                width: 15%;
                display: block;
                margin: 0 auto;
                margin-top: 0.3125em;
                margin-bottom: 0.1em;
            }
            
            footer nav span {
                color: #020202;
            }
            
            footer nav .action span {
                color: #ff3366;
            }
            footer ul{ display: none;  position: absolute; top: -6em; left: 0; width: 100%; z-index: 100;}
            footer li{ line-height: 3em; height: 3em; background: url(img/opa_bai.png) repeat; text-indent: 0;}
            footer li img{ width: 1.5em; margin: 0.5em; margin-top: 0.1875em; vertical-align: middle;}
            footer a{color: #666; display: inline-block; height: 3em; line-height: 3em;}
            #info textarea{ margin: 0; padding: 0; border: none; outline: none; background-color: #f8f8f8;    line-height: 1.3em;
    font-size: 0.85em;}
        </style>
	</head>

	<body>
		<header>
			<a><span class="leftleft"></span></a>
			<h1 id="typeName">活动详情</h1>
			<a class="xiaoxi2" cardId=''>名片</a>
		</header>
		
		<section class="xiangqing" id="info">
		</section>
		<footer>
			<div class="caozuo">
				<a id="caozuo"><img src="../img/setting.png" />
					操作
					<ul>
						<li id="guanzhu"><img src="../img/eyes.png" />关注</li>
						<!--<li id="fenxiang"><img src="../img/share.png" />分享</li> -->
						<li id="chongfu" style="display: none;"><img src="../img/repeat.png" />重复</li>
						<li id="shuitie"><img src="../img/shuitie.png" />水贴</li>
					</ul>
				</a>
				
			</div>
			<div class="liulan">
				<p><img src="../img/eyes2.png" />浏览<i id="viewCount">0</i>次</p>
			</div>
		</footer>
		<script>
			$(document).ready(function(){
				$("#caozuo").click(function(){
					if($(this).find("ul").css("display") == "block"){
						$(this).find("ul").hide()
					}else{
						$(this).find("ul").show()
					}
				});
				$("#caozuo li").click(function(event){
		            event.stopPropagation();
		       });
		       
		       var actId = getVal("actId");
		       if(actId!=""){
		          //关注
                    $("#guanzhu").click(function(){
                        if(!!!appcan.locStorage.getVal("userId")){
                            alert("请登录");
                            return false;
                        }
                        appcan.ajax({
                            type:"post",
                            url:host+"/operateAct.json?actId="+actId+"&logType=1&userId="+appcan.locStorage.getVal("userId"),
                            dataType:"json",
                            contentType: "application/json",
                            success : function(dataResult) {
                                if(dataResult.status == 0){
                                    alert(dataResult.msg);
                                }else{
                                    alert("操作成功！");
                                }
                            }
                        })
                    })
                    //分享
                    $("#fenxiang").click(function(){
                        if(!!!appcan.locStorage.getVal("userId")){
                            alert("请登录");
                            return false;
                        }
                        appcan.ajax({
                            type:"post",
                            url:host+"/operateAct.json?actId="+actId+"&logType=2&userId="+appcan.locStorage.getVal("userId"),
                            dataType:"json",
                            contentType: "application/json",
                            success : function(dataResult) {
                                if(dataResult.status == 0){
                                    alert(dataResult.msg);
                                }else{
                                    alert("操作成功！");
                                }
                            }
                        })
                    })
                    //重复
                    $("#chongfu").click(function(){
                        if(!!!appcan.locStorage.getVal("userId")){
                            alert("请登录");
                            return false;
                        }
                        appcan.ajax({
                            type:"post",
                            url:host+"/operateAct.json?actId="+actId+"&logType=3&userId="+appcan.locStorage.getVal("userId"),
                            dataType:"json",
                            contentType: "application/json",
                            success : function(dataResult) {
                                if(dataResult.status == 0){
                                    alert(dataResult.msg);
                                }else{
                                    alert("操作成功！");
                                }
                            }
                        })
                    })
                    //水贴
                    $("#shuitie").click(function(){
                        if(!!!appcan.locStorage.getVal("userId")){
                            alert("请登录");
                            return false;
                        }
                        appcan.ajax({
                            type:"post",
                            url:host+"/operateAct.json?actId="+actId+"&logType=4&userId="+appcan.locStorage.getVal("userId"),
                            dataType:"json",
                            contentType: "application/json",
                            success : function(dataResult) {
                                if(dataResult.status == 0){
                                    alert(dataResult.msg);
                                }else{
                                    alert("操作成功！");
                                }
                            }
                        })
                    })
                    //活动详情
    		          appcan.ajax({
                        type:"post",
                        url:host+"/getActive.json?actId="+actId,
                        dataType:"json",
                        contentType: "application/json",
                        success : function(dataResult) {
                            var data = dataResult.data;
                            $(".xiaoxi2").attr("cardId", data.cardId);
                            var actStr = "";
                            var actType = data.actType.substring(0,1);
                            switch(actType){
                                case "A":
                                    $("#typeName").text("名优详情");
                                    break;
                                case "B":
                                    $("#chongfu").show();
                                    $("#chongfu").parent("ul").attr("style", "top: -9em;");
                                    $("#typeName").text("同城购详情");
                                    break;
                                case "C":
                                    $("#typeName").text("超市详情");
                                    break;
                                case "D":
                                    $("#typeName").text("母婴详情");
                                    break;
                                case "E":
                                    $("#typeName").text("车辆详情");
                                    break;
                                case "F":
                                    $("#typeName").text("房产详情");
                                    break;
                            }
                            if(data.isInit == "1"){
                                actStr+='<img src="'+hostIp+data.mainPic+'" />';
                            }
                            actStr+=data.detailContent;
                            $("#info").html(actStr);
                            $(".opa").remove();
                            $("#viewCount").html(data.viewCount!=null? data.viewCount : 0);
                            $.each($("#info textarea"), function(){
                                if($(this).text().length==0){
                                    $(this).remove();
                                }
                            });
                        }
                    })
                    //浏览记录
                    appcan.ajax({
                        type:"post",
                        url:host+"/addViewCount.json?actId="+actId+"&userId="+appcan.locStorage.getVal("userId"),
                        dataType:"json",
                        contentType: "application/json",
                        success : function(dataResult) {
                        }
                    })
    		       }
			 });
		</script>
	</body>
</html>